/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package entity;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author hafiz anshori
 */
@Entity
@Table(name = "daftar_menu", catalog = "sirere", schema = "")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "DaftarMenu.findAll", query = "SELECT d FROM DaftarMenu d"),
    @NamedQuery(name = "DaftarMenu.findByIdMenu", query = "SELECT d FROM DaftarMenu d WHERE d.idMenu = :idMenu"),
    @NamedQuery(name = "DaftarMenu.findByNamaMenu", query = "SELECT d FROM DaftarMenu d WHERE d.namaMenu = :namaMenu"),
    @NamedQuery(name = "DaftarMenu.findByStok", query = "SELECT d FROM DaftarMenu d WHERE d.stok = :stok")})
public class DaftarMenu implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "id_menu", nullable = false)
    private Integer idMenu;
    @Basic(optional = false)
    @Column(name = "nama_menu", nullable = false, length = 30)
    private String namaMenu;
    @Basic(optional = false)
    @Column(name = "stok", nullable = false, length = 30)
    private String stok;

    public DaftarMenu() {
    }

    public DaftarMenu(Integer idMenu) {
        this.idMenu = idMenu;
    }

    public DaftarMenu(Integer idMenu, String namaMenu, String stok) {
        this.idMenu = idMenu;
        this.namaMenu = namaMenu;
        this.stok = stok;
    }

    public Integer getIdMenu() {
        return idMenu;
    }

    public void setIdMenu(Integer idMenu) {
        this.idMenu = idMenu;
    }

    public String getNamaMenu() {
        return namaMenu;
    }

    public void setNamaMenu(String namaMenu) {
        this.namaMenu = namaMenu;
    }

    public String getStok() {
        return stok;
    }

    public void setStok(String stok) {
        this.stok = stok;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idMenu != null ? idMenu.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof DaftarMenu)) {
            return false;
        }
        DaftarMenu other = (DaftarMenu) object;
        if ((this.idMenu == null && other.idMenu != null) || (this.idMenu != null && !this.idMenu.equals(other.idMenu))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "entity.DaftarMenu[ idMenu=" + idMenu + " ]";
    }
    
}
